package com.shiro.demo3.controller;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.shiro.demo3.entity.User;
import com.shiro.demo3.service.UserService;
import com.shiro.demo3.utils.R;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.Collections;
import java.util.List;
import java.util.stream.Collectors;

@RestController
@RequestMapping("/test")
public class TestController {
    @Autowired
    private UserService userService;
    @RequestMapping("/test")
    public R test(){
        QueryWrapper<User> queryWrapper = new QueryWrapper<>();
        queryWrapper.select("userid,username");
        List<User> list = userService.list(queryWrapper);
        return R.success().data(list);
    }
}
